import {defHttp} from '/@/utils/http/axios'

enum Api {
  PRODUCT_INFO = '/product/getProductInfo',
  GROUP_PRODUCT_INFO = '/product/getGroupProductInfos',
  ASIN_TO_PRODUCT = '/product/getProductByAsin',
  PRODUCT_DETAIL = '/product/getProductDetail',
  PRODUCT_DELETE = '/product/deleteProduct',
  PRODUCT_MARK = '/product/markProduct',
  PRODUCT_LINE = '/product/getProductLine',
  PRODUCT_GROUP_LINE = '/product/getGroupProductLine',
  SJ_NAME_PRODUCT = '/product/getProductBySjName',
  SJ_NAME_PRODUCT_GROUP = '/product/getProductBySjNameGroup',
  DAY_AVG_ORDER = '/product/getDayAvgOrder',
  LiNE_TOTAL_ANALYSE = '/product/productLineTotalAnalyse',
  UPDATE_ASIN_ORDER = '/product/updateAsinOrder',
  EXPORT_XLS = '/product/exportXls',
}

export const productInfoApi = (params) =>
  defHttp.post<any>({url: Api.PRODUCT_INFO, params: params})

export const productGroupInfoApi = (params) =>
  defHttp.post<any>({url: Api.GROUP_PRODUCT_INFO, params: params})

export const AsinToProductApi = (params) =>
  defHttp.post<any>({url: Api.ASIN_TO_PRODUCT, params: params})

export const getProductDetail = (params) =>
  defHttp.post<any>({url: Api.PRODUCT_DETAIL, params: params})

export const deleteProduct = (params) =>
  defHttp.post<any>({url: Api.PRODUCT_DELETE, params: params})

export const markProduct = (params) => defHttp.post<any>({url: Api.PRODUCT_MARK, params: params})

export const getProductLine = (params) =>
  defHttp.post<any>({url: Api.PRODUCT_LINE, params: params})

export const getGroupProductLine = (params) =>
  defHttp.post<any>({url: Api.PRODUCT_GROUP_LINE, params: params})

export const getProductBySjName = (params) =>
  defHttp.post<any>({url: Api.SJ_NAME_PRODUCT, params: params})

export const getProductBySjNameGroup = (params) =>
  defHttp.post<any>({url: Api.SJ_NAME_PRODUCT_GROUP, params: params})

export const getAvgOrder = (params) =>
  defHttp.post<any>({url: Api.DAY_AVG_ORDER, params: params})

export const productLineTotalAnalyse = (params) =>
  defHttp.post<any>({url: Api.LiNE_TOTAL_ANALYSE, params: params})

export const updateAsinOrder = (params) =>
  defHttp.post<any>({url: Api.UPDATE_ASIN_ORDER, params: params})

export const exportXls = (params) =>
  defHttp.post<any>({url: Api.EXPORT_XLS, params: params})
